#!/usr/bin/python
#coding:utf8
'''
Bridge
'''
# 颜色类
class Color:
    def __init__(self,color):
        self.color = color
    def fill(self):
        pass

class Red(Color):
    def fill(self):
        print(f"fill {self.color}")

class Green(Color):
    def fill(self):
        print(f"fill {self.color}")

# 图形类    
class Shape:
    def __init__(self,color):
        self.color = color
    def draw(self):
        pass

class Rectangle(Shape):
    def draw(self):
        print("draw rectangle", end = ' ')
        self.color.fill()

class Circle(Shape):
    def draw(self):
        print("draw circle", end = ' ')
        self.color.fill()


if __name__ == '__main__':
    red = Red("red")
    green = Green("green")
    red_rectangle = Rectangle(red)
    green_circle = Circle(green)
    red_rectangle.draw()
    green_circle.draw()